package collection;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;

public class CollectionDemo4 {

    public static void main(String[] args) {
        Collection cd = new ArrayList();
        cd.add(11);
        cd.add("one");
        cd.add("five");
        System.out.println(cd);

        Iterator<String> it= cd.iterator();
        while(it.hasNext()){
            String next = it.next();
            if(next.equals("a")){
                it.remove();
            }
        }
        System.out.println();
    }
}
